<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <title>Document</title>
  </head>
  <body>
    <script>
      var score = prompt('请输入0~100范围内的数字');
      switch (parseInt(score / 10)) {
        case 10:
          console.log('满分');
        case 9:
          console.log('优');
          break;
        case 8:
          console.log('良');
          break;
        default:
          console.log('差');
      }
    </script>
  </body>
</html>